<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
  <title>Simple JavaScript Application</title>
  <!-- (1) Load library scripts, courtesy of Yahoo! YUI. -->
  <script src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>
  <script src="http://yui.yahooapis.com/2.6.0/build/element/element-beta-min.js" type="text/javascript"></script>
</head>
<body>
  <!-- (2) Render a button control. -->
  <input id="hello-button" type="button" value="Say Hello World!" />
  <br /><br />
  <!-- (3) Provide a message area. --> 
 <div id="hello-div"></div>
  <!-- (4) Initialize the button and div, define the "handleClick" function and attach it to the button. -->
  <script>
    var elButton = new YAHOO.util.Element("hello-button");
    var elDiv = YAHOO.util.Dom.get("hello-div");
    var handleClick = function(e) {
        elDiv.innerHTML = this.get("value");
        alert(this.get("id") + " raised " + e.type);
        this.removeListener(handleClick);
    };
    elButton.on("click", handleClick, elButton); 
  </script>
  </body>
</html> 
